package com.east.mapper;

import com.east.common.DataFilter;
import com.east.entity.User;
import com.east.query.BaseQuery;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Map;

/**
 * @author eastj
 * @description 针对表【t_user(用户表)】的数据库操作Mapper
 * @createDate 2025-01-17 20:43:35
 * @Entity com.east.entity.User
 */
@Mapper
public interface UserMapper {

    int deleteByPrimaryKey(Long id);

    int insert(User record);

    int insertSelective(User record);

    User selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);

    User selectByLoginAct(String username);

    List<User> getAllUser();

    List<User> searchUser(String phone, String loginAct, String name);

    int deleteUserByIds(Integer[] ids);


    int addUser(User user);

    @MapKey("id")
    @DataFilter(tableAlias = "tu",fieldName = "id")
    List<Map<Integer, String>> getAllUserNames(BaseQuery baseQuery);

    User info(Long id);
}
